package com.heima.kafka.listener;

import org.apache.commons.lang3.StringUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class HelloListener {

    @KafkaListener(topics = "topic-test")
    public void onMessage(String message) {
        if (StringUtils.isNoneBlank(message)) {
            System.out.println("接收到kafka中的消息: " + message);
        }
    }
}
